#include "AutomatVar1.h"
#include <stdio.h>
#include <stdlib.h>


AutomatVar1::AutomatVar1(IScanner* scanner) :
    currentState(State0::makeState()),
    scanner(scanner)
{
}

AutomatVar1::~AutomatVar1(void)
{
    delete currentState;
}

void AutomatVar1::readChar(char c)
{
    currentState->read(c, this);
}

void AutomatVar1::setCurrentState(IState* state)
{
    currentState = state;
}

void AutomatVar1::mkToken(TType type, long long value, unsigned int row, unsigned int col)
{
    scanner->mkToken(type, value, row, col);
}

void AutomatVar1::ungetChar(int times)
{
    scanner->ungetChar(times);
}

void AutomatVar1::stop()
{
    scanner->stop();
}

void AutomatVar1::putCharForInteger(char c)//from clgr
{
    scanner->putCharForInteger(c);
}

void AutomatVar1::putCharForIdentifier(char c)//from clgr
{
    scanner->putCharForIdentifier(c);
}

unsigned int AutomatVar1::getRow()//from clgr
{
    return scanner->getRow();
}

unsigned int AutomatVar1::getCol()//from clgr
{
    return scanner->getCol();
}

void AutomatVar1::error()
{
    if(EXIT_ON_ERROR){
        fprintf(stderr, "AutomatVar1::error() -> EXITING!\n");
        exit(1);
    }
}
